﻿using System;
using System.ComponentModel.DataAnnotations;
using KL.UFrame.Data.Entities;

namespace KL.UFrame.Data.Models
{
    public class TrainningModel:CurdModel
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "分类")]
        public int CategoryId { get; set; }

        [Display(Name = "分类名称")]
        public string Category { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50,ErrorMessage = "{0}不能超过{1}位")]
        [Display(Name = "名称")]
        public string Title { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "人数限制")]
        [Range(1, int.MaxValue,ErrorMessage = "{0}必须大于{1}")]
        public int UserLimit { get; set; }
    }

    public class TrainningCategoryModel : CurdModel
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50, ErrorMessage = "{0}不能超过{1}位")]
        [Display(Name = "名称")]
        public string Name { get; set; }
        
    }

    public class EnrollModel 
    {
        public int Id { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50, ErrorMessage = "{0}不能超过{1}位")]
        [Display(Name = "姓名")]
        public string Name { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(18,MinimumLength = 18, ErrorMessage = "{0}必须是{1}位")]
        [Display(Name = "身份证")]
        public string IdCard { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "性别")]
        public int Gender { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "年龄")]
        public int Age { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(11, ErrorMessage = "{0}不能超过{1}位")]
        [Display(Name = "手机号")]
        public string Phone { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "培训Id")]
        public int TrainningId { get; set; }

        [Display(Name = "培训名称")]
        public string TrainningName { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "报名时间")]
        public DateTime CreateTime  { get; set; }

        public EnrollStatus EnrollStatus { get; set; }

        public int UserLimit { get; set; }
        public string StatusDescription { get; set; }
    }

    public class EnrollSummaryModel
    {
        public string Name { get; set; }

        public string TrainningName { get; set; }

        public DateTime CreateTime { get; set; }

        public string Status { get; set; }

        public string StatusDescription { get; set; }
    }
}
